import request from './request'

// 登录方法
// export function login(username, password, code, uuid) {
export function login (userName, passWord) {
  const data = {
    userName,
    passWord
  }
  return request({
    url: '/user/userLogin',
    method: 'post',
    data: data,
    headers: {
      isToken: false,
      repeatSubmit: false
    }
  })
}
// test/testPage
// 路由方法
export const getRouters = () => {
  return request({
    url: '/user/route',
    method: 'get',
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 登出
export const userLogOut = () => {
  return request({
    url: '/user/logOut',
    method: 'get',
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 短信验证码
export const PwdCode = (phone, userName) => {
  return request({
    url: '/sms/sendUpdatePwdCode',
    method: 'get',
    param: {
      phone, userName
    },
    headers: {
      isToken: false,
      repeatSubmit: false
    }
  })
}

// 修改密码
export function updatePwd (data) {
  return request({
    url: '/user/updatePwd',
    method: 'post',
    data,
    headers: {
      isToken: false,
      repeatSubmit: false
    }
  })
}
